﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="DanhSachNhanVien.aspx.cs" Inherits="EC2011_hk1_BT3_1041074_1041078_1042119.DanhSachNhanVien" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    
    <div id="right">
		<div class="content">
	        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:PagingDataConnectionString %>" 
                
                SelectCommand="SELECT * FROM [Employees] WHERE ([DepartmentID] = @DepartmentID)">
                <SelectParameters>
                    <asp:QueryStringParameter DefaultValue="1" Name="DepartmentID" 
                        QueryStringField="Id" Type="Int32" />
                </SelectParameters>
            </asp:SqlDataSource>

            <h3>Danh Danh sách Nhân Viên theo Phòng Ban</h3>
            <div class="clear"></div>
                <asp:GridView ID="GridView1" runat="server" Visible="False" 
                AllowPaging="True" AutoGenerateColumns="False" DataKeyNames="EmployeeID" 
                DataSourceID="SqlDataSource1">
                    <Columns>
                        <asp:BoundField DataField="EmployeeID" HeaderText="EmployeeID" 
                            InsertVisible="False" ReadOnly="True" SortExpression="EmployeeID" />
                        <asp:BoundField DataField="LastName" HeaderText="LastName" 
                            SortExpression="LastName" />
                        <asp:BoundField DataField="FirstName" HeaderText="FirstName" 
                            SortExpression="FirstName" />
                        <asp:BoundField DataField="DepartmentID" HeaderText="DepartmentID" 
                            SortExpression="DepartmentID" />
                        <asp:BoundField DataField="Salary" HeaderText="Salary" 
                            SortExpression="Salary" />
                        <%--<asp:BoundField DataField="HireDate" HeaderText="HireDate" 
                            SortExpression="HireDate" />--%>
                        <asp:BoundField DataField="URLPersonalPhoto" HeaderText="URLPersonalPhoto" 
                            SortExpression="URLPersonalPhoto" />
                        <%--<asp:BoundField DataField="Description" HeaderText="Description" 
                            SortExpression="Description" />--%>
                    </Columns>
                </asp:GridView>
                <asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Visible="False" 
                    Width="125px" AutoGenerateRows="False" DataKeyNames="EmployeeID" 
                DataSourceID="SqlDataSource1">
                    <Fields>
                        <asp:BoundField DataField="EmployeeID" HeaderText="EmployeeID" 
                            InsertVisible="False" ReadOnly="True" SortExpression="EmployeeID" />
                        <asp:BoundField DataField="LastName" HeaderText="LastName" 
                            SortExpression="LastName" />
                        <asp:BoundField DataField="FirstName" HeaderText="FirstName" 
                            SortExpression="FirstName" />
                        <asp:BoundField DataField="DepartmentID" HeaderText="DepartmentID" 
                            SortExpression="DepartmentID" />
                        <asp:BoundField DataField="Salary" HeaderText="Salary" 
                            SortExpression="Salary" />
                        <asp:BoundField DataField="HireDate" HeaderText="HireDate" 
                            SortExpression="HireDate" />
                        <asp:BoundField DataField="URLPersonalPhoto" HeaderText="URLPersonalPhoto" 
                            SortExpression="URLPersonalPhoto" />
                        <asp:BoundField DataField="Description" HeaderText="Description" 
                            SortExpression="Description" />
                    </Fields>
                </asp:DetailsView>
                <asp:Repeater ID="Repeater1" runat="server" Visible="False" 
                DataSourceID="SqlDataSource1">
                    <HeaderTemplate>
                        <table border="1" width="100%">
                            <tr>
                                <th>EmployeeID</th>
                                <th>Last Name</th>
                                <th>First Name</th>
                                <th>DepartmentID</th>
                                <th>Salary</th>
                            </tr>
                    </HeaderTemplate>

                    <ItemTemplate>
                        <tr>
                            <td><asp:Label ID="EmployeeIDLabel" runat="server" Text='<%# Eval("EmployeeID") %>' /></td>
                            <td><asp:Label ID="Label1" runat="server" Text='<%# Eval("LastName") %>' /></td>
                            <td><asp:Label ID="Label2" runat="server" Text='<%# Eval("FirstName") %>' /></td>
                            <td><asp:Label ID="Label3" runat="server" Text='<%# Eval("DepartmentID") %>' /></td>
                            <td><asp:Label ID="Label4" runat="server" Text='<%# Eval("Salary") %>' /></td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        </table>
                    </FooterTemplate>
                </asp:Repeater>
                <asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1" 
                DataKeyField="EmployeeID" Visible="False" BackColor="White" 
                BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" CellPadding="3" 
                GridLines="Horizontal" RepeatColumns="2">
                    <AlternatingItemStyle BackColor="#F7F7F7" />
                    <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
                    <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
                    <ItemStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
                    <ItemTemplate>
                        EmployeeID:
                        <asp:Label ID="EmployeeIDLabel" runat="server" 
                            Text='<%# Eval("EmployeeID") %>' />
                        <br />
                        LastName:
                        <asp:Label ID="LastNameLabel" runat="server" Text='<%# Eval("LastName") %>' />
                        <br />
                        FirstName:
                        <asp:Label ID="FirstNameLabel" runat="server" Text='<%# Eval("FirstName") %>' />
                        <br />
                        DepartmentID:
                        <asp:Label ID="DepartmentIDLabel" runat="server" 
                            Text='<%# Eval("DepartmentID") %>' />
                        <br />
                        Salary:
                        <asp:Label ID="SalaryLabel" runat="server" Text='<%# Eval("Salary") %>' />
                        <br />
                        HireDate:
                        <asp:Label ID="HireDateLabel" runat="server" Text='<%# Eval("HireDate") %>' />
                        <br />
                        URLPersonalPhoto:
                        <asp:Label ID="URLPersonalPhotoLabel" runat="server" 
                            Text='<%# Eval("URLPersonalPhoto") %>' />
                        <br />
                        Description:
                        <asp:Label ID="DescriptionLabel" runat="server" 
                            Text='<%# Eval("Description") %>' />
                        <br />
                        <br />
                    </ItemTemplate>
                    <SelectedItemStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
                </asp:DataList>
		</div>              
    </div>
</asp:Content>
